home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / text / xes.lha / XES / REXX / SaveFile.xdme < prev    next >
Text File  |  1995-08-01  |  996b  |  36 lines

  1. /* $VER: SaveFile.xdme 1.0 (01 Aug 1995) */
  2. /* Copyright © 1994 Fergus Duniho */
  3.  
  4. if ~show("L","rexxsupport.library") then
  5.     if ~addlib("rexxsupport.library",0,-30,0) then exit
  6.  
  7. options results
  8. address 'XDME.1'
  9. 'rxresult $method'
  10. method = result
  11. compressor = "LIBS:compressors/xpk" || method || ".library"
  12. 'rxresult $filename'
  13. fullname = result
  14.  
  15. IF method = "NONE" | ~Exists(compressor) THEN DO
  16.     saveold
  17.     /* This is to compensate for a bug in XDME */
  18.     com = "protect """ || fullname || """ +rwd"
  19.     ADDRESS Command Com
  20. END
  21. ELSE DO
  22.     'writeto t:temp'
  23.     /* This is to compensate for a bug in XDME */
  24.     ADDRESS Command "protect t:temp +rwd"
  25.     'rxresult $password'
  26.     password = result
  27.     if password = "RESULT" then
  28.         xcom = 'execute (xpack t:temp method' method || ')'
  29.     ELSE
  30.         xcom = 'execute (xpack t:temp method' method 'password "' || password || '")'
  31.     xcom
  32.     xcom = "execute (copy t:temp """ || fullname || """)"
  33.     xcom
  34.     CALL Delete("t:temp")
  35. END
  36.